import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_app/home/MovieScroll.dart';

class HomeBody extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ListView(
      // scrollDirection: Axis.horizontal,
      children: <Widget>[
        HomeBodyArea(title: '最新电影'),
        HomeBodyArea(title: '最热剧集'),
        HomeBodyArea(title: '最嗨动漫'),
        HomeBodyArea(title: '伦理综艺'),
      ],
    );
  }
}

class HomeBodyArea extends StatelessWidget {
  HomeBodyArea({Key key, @required this.title}) : super(key: key);
  final String title;
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        children: <Widget>[
          Padding(
            padding: EdgeInsets.only(left: 5, right: 5),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween, //主轴
              children: <Widget>[
                Text(
                  title,
                  style: TextStyle(fontSize: 18, height: 1.3),
                ),
                Text('>>', style: TextStyle(color: Colors.blue))
              ],
            ),
          ),
          //电影无缝滚动区域
          MovieScroll()
        ],
      ),
    );
  }
}
